#ifndef SQLPARSER_SQLSTATEMENT_H
#define SQLPARSER_SQLSTATEMENT_H

#include <vector>
#include <string>
#include "Stat.h"


namespace ment {
	enum StatementType {
		ForError,
		ForSelect,
		ForImport,
		ForInsert,
		ForUpdate,
		ForDelete,
		ForCreate,
		ForDrop,
		ForPrepare,
		ForExecute,
		ForExport,
		kStmtRename,
		ForAlter,
		ForShow,
		ForUse
	};

	// Base struct for every SQL statement
	struct SQLStatement {
		SQLStatement(StatementType type);
		virtual ~SQLStatement();
		StatementType type() const;

		bool isType(StatementType type) const;
		bool is(StatementType type) const;//isType的简写

		size_t stringLength;  //SQL语句长度
		std::vector<Stat*>* hints;
		virtual std::string execute(std::string username="default") = 0;//执行语句

		//9.11 语法分析
		int errorLine = -1;     // 默认为 -1，表示未设置
		int errorColumn = -1;   // 默认为 -1，表示未设置


	private:
		StatementType type_;


	};
} 


#endif // SQLPARSER_SQLSTATEMENT_H
